
PRGNAME = cppmongo
OBJ = cppmongo.o
DEBUG=-O0 -ggdb3
MONGO_ROOT=/sourcecode/opensource/mongo-cxx-driver
MONGO_INCLUDE=$(MONGO_ROOT)/mongo
MONGO_CLIENT=$(MONGO_ROOT)/libmongoclient.a
INCFLAGS = -I$(MONGO_INCLUDE) -I../texting/src -I/usr/local/include
LIBPATH=  -L/usr/local/lib
CXXFLAGS = $(LIBPATH) $(INCFLAGS)
WARN=-Wall

LIBS = -lboost_system -lboost_thread -lboost_program_options -lpcre++ -lyaml-cpp -lscws

.cc.o:
	$(CXX) $(INCFLAGS) $(DEBUG) $(WARN) $(CXXFLAGS) -c $<

cppmongo: $(OBJ)
	$(CXX) -o $(PRGNAME) $(DEBUG) $(WARN) $(OBJ) $(CXXFLAGS) $(LIBS) $(MONGO_CLIENT)

all: cppmongo


mongohlp: mongohlp.o
	$(CXX) -o mongohlp $(DEBUG) $(WARN) $< $(CXXFLAGS) $(LIBS) $(MONGO_CLIENT)

word_stats: word_stats.o phraser.o
	$(CXX) -o word_stats $(DEBUG) $(WARN) word_stats.o phraser.o $(CXXFLAGS) $(LIBS) $(MONGO_CLIENT) -lre2  /tmp/lib/libztexting.a

clean: 
	rm cppmongo
	rm mongohlp
	rm *.o


